package common

type SiteAnnouncementManageListRequest struct {
	Page     int32 `form:"page" binding:"required,min=1,max=1000" err:"页码参数错误"`
	PageSize int32 `form:"page_size" binding:"required,min=1,max=2000"  err:"页面大小参数错误"`
}

type SiteAnnouncementManageItem struct {
	Id        int64  `json:"id"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	Url       string `json:"url"`
	Cycle     int32  `json:"cycle"`
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
	CreatedBy string `json:"created_by"`
	CreatedOn string `json:"created_on"`
}

type SiteAnnouncementManageListResponse struct {
	Total int64                         `json:"total"`
	List  []*SiteAnnouncementManageItem `json:"list"`
}

type SiteAnnouncementSaveRequest struct {
	Id        int64  `json:"id"`
	Title     string `json:"title" binding:"required,min=4,max=100" err:"标题必填，并且长度不能大于 100字符"`
	Content   string `json:"content" binding:"required" err:"内容为必填项"`
	Url       string `json:"url" binding:"required,max=255" err:"链接长度不能超过255字符或者不能为空"`
	Cycle     int32  `json:"cycle" binding:"oneof=1 2" err:"非法的频率参数"`
	StartTime string `json:"start_time" binding:"dateTime" err:"时间格式错误"`
	EndTime   string `json:"end_time" binding:"dateTime" err:"时间格式错误"`
}

type SiteAnnouncementSaveResponse struct {
	Id int64 `json:"id"`
}

type SiteAnnouncementDetailRequest struct {
	Id int64 `form:"id" binding:"required" err:"Id 参数为必填"`
}

type SiteAnnouncementDetailResponse struct {
	Id        int64  `json:"id"`
	Title     string `json:"title"`
	Content   string `json:"content"`
	Url       string `json:"url"`
	Cycle     int32  `json:"cycle"`
	StartTime string `json:"start_time"`
	EndTime   string `json:"end_time"`
	CreatedBy string `json:"created_by"`
	CreatedOn string `json:"created_on"`
}

type SiteAnnouncementDeleteRequest struct {
	Id int64 `form:"id" binding:"required" err:"Id 参数为必填"`
}

type SiteAnnouncementDeleteResponse struct {
}

type SetSiteAnnouncementReadRequest struct {
	Id int64 `json:"id" binding:"required" err:"id 为必填项"`
}

type SetSiteAnnouncementReadResponse struct {
	Id int64 `json:"id"`
}

type GetUserSiteAnnouncementListRequest struct {
	Page     int32 `form:"page"`
	PageSize int32 `form:"page_size"`
}

type GetUserSiteAnnouncementListResponse struct {
	Total int64                         `json:"total"`
	List  []*SiteAnnouncementManageItem `json:"list"`
}
